<template>
  <div class="dog-tag-page">
    <!-- 顶部横幅 -->
    <div class="banner-section">
      <div class="banner-content">
        <h1 class="banner-title">高精度定位大牌</h1>
        <p class="banner-subtitle">北斗+GPS多重定位</p>
        <button class="buy-btn">立即购买</button>
      </div>
    </div>

    <!-- 商品列表 - 横向卡片布局 -->
    <div class="product-section">
      <!-- 商品1 -->
      <div class="product-card">
        <div class="product-tag new">新品</div>
        <div class="product-image">
          <!-- 商品图片占满整个顶部区域 -->
          <img src="https://via.placeholder.com/160x120/667eea/ffffff?text=6.8" alt="宠物定位器" class="product-img" />
        </div>
        <div class="product-info">
          <h3 class="product-name">6.8宠物定位器</h3>
          <p class="product-price">299.00元</p>
        </div>
      </div>

      <!-- 商品2 -->
      <div class="product-card">
        <div class="product-tag new">新品</div>
        <div class="product-image">
          <!-- 商品图片占满整个顶部区域 -->
          <img src="https://via.placeholder.com/160x120/764ba2/ffffff?text=炫光版" alt="智能大牌" class="product-img" />
        </div>
        <div class="product-info">
          <h3 class="product-name">炫光版智能大牌（新款）…</h3>
          <p class="product-price">148.00元</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
// 这里可以添加数据逻辑
</script>

<style scoped>
.dog-tag-page {
  padding: 16px;
  background: #f5f5f5;
  min-height: calc(100vh - 140px);
}

/* 横幅样式 */
.banner-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 24px 20px;
  margin-bottom: 20px;
  color: white;
  text-align: center;
}

.banner-title {
  font-size: 20px;
  font-weight: bold;
  margin: 0 0 8px 0;
}

.banner-subtitle {
  font-size: 14px;
  margin: 0 0 16px 0;
  opacity: 0.9;
}

.banner-section .buy-btn {
  background: white;
  color: #667eea;
  border: none;
  border-radius: 20px;
  padding: 10px 30px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* 商品区域 - 横向布局 */
.product-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  position: relative;
  height: 200px; /* 固定卡片高度 */
}

/* 新品标签 */
.product-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  z-index: 2;
}

.product-tag.new {
  background: #ff4444;
  color: white;
}

/* 商品图片 - 占据卡片60%高度 */
.product-image {
  height: 60%; /* 占据卡片60%高度 */
  overflow: hidden;
  position: relative;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 确保图片填满整个区域 */
  display: block;
}

/* 商品信息 - 占据卡片40%高度 */
.product-info {
  height: 40%; /* 占据卡片40%高度 */
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.product-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin: 0 0 8px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 16px;
  color: #ff4444;
  font-weight: bold;
  margin: 0;
}

/* 响应式设计 */
@media (max-width: 375px) {
  .product-section {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .product-card {
    height: 180px;
  }
  
  .product-info {
    padding: 8px;
  }
  
  .product-name {
    font-size: 13px;
  }
  
  .product-price {
    font-size: 14px;
  }
}
</style>